<?php
namespace app\common\exception;


use think\Exception;


/**
 * 异常处理基类
 * Class BaseException
 * @package app\common\exception
 */
class BaseException extends Exception
{
    // 状态码
    public $status;

    // 错误信息
    public $msg = '';

    // 输出的数据
    public $data = [];

    public function __construct($params = [])
    {
        parent::__construct();
        $this->status = $params['status'] ?? config('status.error');
        $this->msg = $params['msg'] ?? '系统错误';
        $this->data = $params['data'] ?? [];
    }
}
